<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>GIMPLE sequences (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="GIMPLE sequences (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="GIMPLE sequences (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="GIMPLE.html" rel="up" title="GIMPLE">
<link href="Sequence-iterators.html" rel="next" title="Sequence iterators">
<link href="Tuple-specific-accessors.html" rel="prev" title="Tuple specific accessors">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="GIMPLE-sequences">
<div class="nav-panel">
<p>
Next: <a href="Sequence-iterators.html" accesskey="n" rel="next">Sequence iterators</a>, Previous: <a href="Tuple-specific-accessors.html" accesskey="p" rel="prev">Tuple specific accessors</a>, Up: <a href="GIMPLE.html" accesskey="u" rel="up">GIMPLE</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="GIMPLE-sequences-1"><span>12.9 GIMPLE sequences<a class="copiable-link" href="#GIMPLE-sequences-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-GIMPLE-sequences"></a>

<p>GIMPLE sequences are the tuple equivalent of <code class="code">STATEMENT_LIST</code>&rsquo;s
used in <code class="code">GENERIC</code>.  They are used to chain statements together, and
when used in conjunction with sequence iterators, provide a
framework for iterating through statements.
</p>
<p>GIMPLE sequences are of type struct <code class="code">gimple_sequence</code>, but are more
commonly passed by reference to functions dealing with sequences.
The type for a sequence pointer is <code class="code">gimple_seq</code> which is the same
as struct <code class="code">gimple_sequence</code> *.  When declaring a local sequence,
you can define a local variable of type struct <code class="code">gimple_sequence</code>.
When declaring a sequence allocated on the garbage collected
heap, use the function <code class="code">gimple_seq_alloc</code> documented below.
</p>
<p>There are convenience functions for iterating through sequences
in the section entitled Sequence Iterators.
</p>
<p>Below is a list of functions to manipulate and query sequences.
</p>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fadd_005fstmt"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_add_stmt</strong> <code class="def-code-arguments">(gimple_seq *seq, gimple g)</code><a class="copiable-link" href="#index-gimple_005fseq_005fadd_005fstmt"> &para;</a></span></dt>
<dd><p>Link a gimple statement to the end of the sequence *<code class="code">SEQ</code> if <code class="code">G</code> is
not <code class="code">NULL</code>.  If *<code class="code">SEQ</code> is <code class="code">NULL</code>, allocate a sequence before linking.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fadd_005fseq"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_add_seq</strong> <code class="def-code-arguments">(gimple_seq *dest, gimple_seq src)</code><a class="copiable-link" href="#index-gimple_005fseq_005fadd_005fseq"> &para;</a></span></dt>
<dd><p>Append sequence <code class="code">SRC</code> to the end of sequence *<code class="code">DEST</code> if <code class="code">SRC</code> is not
<code class="code">NULL</code>.  If *<code class="code">DEST</code> is <code class="code">NULL</code>, allocate a new sequence before
appending.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fdeep_005fcopy"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple_seq</code> <strong class="def-name">gimple_seq_deep_copy</strong> <code class="def-code-arguments">(gimple_seq src)</code><a class="copiable-link" href="#index-gimple_005fseq_005fdeep_005fcopy"> &para;</a></span></dt>
<dd><p>Perform a deep copy of sequence <code class="code">SRC</code> and return the result.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005freverse"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple_seq</code> <strong class="def-name">gimple_seq_reverse</strong> <code class="def-code-arguments">(gimple_seq seq)</code><a class="copiable-link" href="#index-gimple_005fseq_005freverse"> &para;</a></span></dt>
<dd><p>Reverse the order of the statements in the sequence <code class="code">SEQ</code>.  Return
<code class="code">SEQ</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005ffirst"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple</code> <strong class="def-name">gimple_seq_first</strong> <code class="def-code-arguments">(gimple_seq s)</code><a class="copiable-link" href="#index-gimple_005fseq_005ffirst"> &para;</a></span></dt>
<dd><p>Return the first statement in sequence <code class="code">S</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005flast"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple</code> <strong class="def-name">gimple_seq_last</strong> <code class="def-code-arguments">(gimple_seq s)</code><a class="copiable-link" href="#index-gimple_005fseq_005flast"> &para;</a></span></dt>
<dd><p>Return the last statement in sequence <code class="code">S</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fset_005flast"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_set_last</strong> <code class="def-code-arguments">(gimple_seq s, gimple last)</code><a class="copiable-link" href="#index-gimple_005fseq_005fset_005flast"> &para;</a></span></dt>
<dd><p>Set the last statement in sequence <code class="code">S</code> to the statement in <code class="code">LAST</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fset_005ffirst"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_set_first</strong> <code class="def-code-arguments">(gimple_seq s, gimple first)</code><a class="copiable-link" href="#index-gimple_005fseq_005fset_005ffirst"> &para;</a></span></dt>
<dd><p>Set the first statement in sequence <code class="code">S</code> to the statement in <code class="code">FIRST</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005finit"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_init</strong> <code class="def-code-arguments">(gimple_seq s)</code><a class="copiable-link" href="#index-gimple_005fseq_005finit"> &para;</a></span></dt>
<dd><p>Initialize sequence <code class="code">S</code> to an empty sequence.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005falloc"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple_seq</code> <strong class="def-name">gimple_seq_alloc</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-gimple_005fseq_005falloc"> &para;</a></span></dt>
<dd><p>Allocate a new sequence in the garbage collected store and return
it.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fcopy"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">gimple_seq_copy</strong> <code class="def-code-arguments">(gimple_seq dest, gimple_seq src)</code><a class="copiable-link" href="#index-gimple_005fseq_005fcopy"> &para;</a></span></dt>
<dd><p>Copy the sequence <code class="code">SRC</code> into the sequence <code class="code">DEST</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fempty_005fp"><span class="category-def">GIMPLE function: </span><span><code class="def-type">bool</code> <strong class="def-name">gimple_seq_empty_p</strong> <code class="def-code-arguments">(gimple_seq s)</code><a class="copiable-link" href="#index-gimple_005fseq_005fempty_005fp"> &para;</a></span></dt>
<dd><p>Return true if the sequence <code class="code">S</code> is empty.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-bb_005fseq"><span class="category-def">GIMPLE function: </span><span><code class="def-type">gimple_seq</code> <strong class="def-name">bb_seq</strong> <code class="def-code-arguments">(basic_block bb)</code><a class="copiable-link" href="#index-bb_005fseq"> &para;</a></span></dt>
<dd><p>Returns the sequence of statements in <code class="code">BB</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-set_005fbb_005fseq"><span class="category-def">GIMPLE function: </span><span><code class="def-type">void</code> <strong class="def-name">set_bb_seq</strong> <code class="def-code-arguments">(basic_block bb, gimple_seq seq)</code><a class="copiable-link" href="#index-set_005fbb_005fseq"> &para;</a></span></dt>
<dd><p>Sets the sequence of statements in <code class="code">BB</code> to <code class="code">SEQ</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-gimple_005fseq_005fsingleton_005fp"><span class="category-def">GIMPLE function: </span><span><code class="def-type">bool</code> <strong class="def-name">gimple_seq_singleton_p</strong> <code class="def-code-arguments">(gimple_seq seq)</code><a class="copiable-link" href="#index-gimple_005fseq_005fsingleton_005fp"> &para;</a></span></dt>
<dd><p>Determine whether <code class="code">SEQ</code> contains exactly one statement.
</p></dd></dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Sequence-iterators.html">Sequence iterators</a>, Previous: <a href="Tuple-specific-accessors.html">Tuple specific accessors</a>, Up: <a href="GIMPLE.html">GIMPLE</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
